<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:30:"./themes/admin/user\index.html";i:1597635477;s:24:"./themes/admin/base.html";i:1597220008;}*/ ?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>德信商城</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" href="__JS__/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__CSS__/font-awesome.min.css">
    <!--CSS引用-->
    
    <link rel="stylesheet" href="__CSS__/admin.css">
    <!--[if lt IE 9]>
    <script src="__CSS__/html5shiv.min.js"></script>
    <script src="__CSS__/respond.min.js"></script>
    <![endif]-->
</head>
<script src="__JS__/jquery.min.js"></script>
<body>
<div class="layui-layout layui-layout-admin">
    <!--头部-->
    <div class="layui-header header">
        <a href=""><img class="logo" src="__STATIC__/images/admin_logo.png" alt=""></a>
        <ul class="layui-nav" style="position: absolute;top: 0;right: 20px;background: none;">
            <!--<li class="layui-nav-item"><a href="<?php echo url('/'); ?>" target="_blank">前台首页</a></li>-->
            <li class="layui-nav-item"><a href="" data-url="<?php echo url('admin/system/clear'); ?>" id="clear-cache">清除缓存</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;"><?php echo session('admin_name'); ?></a>
                <dl class="layui-nav-child"> <!-- 二级菜单 -->
                    <dd><a href="<?php echo url('admin/change_password/index'); ?>">修改密码</a></dd>
                    <dd><a href="<?php echo url('admin/login/logout'); ?>">退出登录</a></dd>
                </dl>
            </li>
        </ul>
    </div>

    <!--侧边栏-->
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree">
                <li class="layui-nav-item layui-nav-title"><a>管理菜单</a></li>
                <li class="layui-nav-item">
                    <a href="<?php echo url('admin/index/index'); ?>"><i class="fa fa-home"></i> 网站信息</a>
                </li>
                <?php if(is_array($menu) || $menu instanceof \think\Collection || $menu instanceof \think\Paginator): if( count($menu)==0 ) : echo "" ;else: foreach($menu as $key=>$vo): if(isset($vo['children'])): ?>
                <li class="layui-nav-item">
                    <a href="javascript:;"><i class="<?php echo $vo['icon']; ?>"></i> <?php echo $vo['title']; ?></a>
                    <dl class="layui-nav-child">
                        <?php if(is_array($vo['children']) || $vo['children'] instanceof \think\Collection || $vo['children'] instanceof \think\Paginator): if( count($vo['children'])==0 ) : echo "" ;else: foreach($vo['children'] as $key=>$v): ?>
                        <dd><a href="<?php echo url($v['name']); ?>"> <?php echo $v['title']; ?></a></dd>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </dl>
                </li>
                <?php else: ?>
                <li class="layui-nav-item">
                    <a href="<?php echo url($vo['name']); ?>"><i class="<?php echo $vo['icon']; ?>"></i> <?php echo $vo['title']; ?></a>
                </li>
                <?php endif; endforeach; endif; else: echo "" ;endif; ?>

                <li class="layui-nav-item" style="height: 30px; text-align: center"></li>
            </ul>
        </div>
    </div>

    <!--主体-->
    
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">用户管理</li>
            <!--<li class=""><a href="<?php echo url('admin/user/add'); ?>">添加用户</a></li>-->
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">

                <form class="layui-form layui-form-pane" action="<?php echo url('admin/user/index'); ?>" method="get">
                    <div class="layui-inline">
                        <label class="layui-form-label">手机号搜索</label>
                        <div class="layui-input-inline">
                            <input type="text" name="keyword" value="<?php echo $keyword; ?>" placeholder="请输入手机号" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn">搜索</button>
                    </div>
                </form>
                <hr>
                <div class="layui-inline">
                    <label class="layui-form-label" style="!important; width: 120px;">一级以上会员数</label>
                    <div class="layui-input-inline">
                        <input type="text" value="<?php echo $pingtai; ?>" class="layui-input" readonly>
                    </div>
                </div>
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th style="width: 30px;">ID</th>
                        <th>用户名</th>
                        <th>上级用户名</th>
                        <th>手机</th>
                        <th>等级</th>
                        <th>性别</th>
                        <!--<th>状态</th>-->
                        <th>收入</th>
                        <th>收货信息</th>
                        <th>创建时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php if(is_array($user_list) || $user_list instanceof \think\Collection || $user_list instanceof \think\Paginator): if( count($user_list)==0 ) : echo "" ;else: foreach($user_list as $key=>$vo): ?>
                    <tr>
                        <td><?php echo $vo['id']; ?></td>
                        <td><?php echo $vo['username']; ?></td>
                        <td><?php echo $vo['up_user']; ?></td>
                        <td><?php echo $vo['mobile']; ?></td>
                        <td><?php echo $vo['level']; ?></td>
                        <td><?php echo $vo['sex']==0 ? '保密' : ($vo['sex']==1?'男':'女'); ?></td>
                        <!--<td><?php echo $vo['status']==1 ? '启用' : '禁用'; ?></td>-->
                        <td><?php echo $vo['money']; ?></td>
                        <td>收货地址：<br><?php echo $vo['province']; ?>/<?php echo $vo['city']; ?>/<?php echo $vo['area']; ?>/<?php echo $vo['address']; ?><br>收货人信息：<br><?php echo $vo['contact']; ?>/<?php echo $vo['phone']; ?></td>
                        <td><?php echo $vo['create_time']; ?></td>
                        <td>
                            <!--<a href="<?php echo url('admin/user/edit',['id'=>$vo['id']]); ?>" class="layui-btn layui-btn-normal layui-btn-mini">编辑</a>-->
                            <a    id="<?php echo $vo['id']; ?>" class="layui-btn layui-btn-normal layui-btn-mini llll">编辑等级</a>



                            <!--<div class="site-demo-button" id="layerDemo" style="margin-bottom: 0;">-->
                            <!--<button data-method="notice" class="layui-btn layui-btn-danger layui-btn-mini ajax-delete">审核</button>-->
                            <!--</div>-->



                            <a href="<?php echo url('admin/user/delete',['id'=>$vo['id']]); ?>" class="layui-btn layui-btn-danger layui-btn-mini ajax-delete">删除</a>
                        </td>
                    </tr>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                    </tbody>
                </table>
                <!--分页-->
                <?php echo $user_list->render(); ?>
            </div>
        </div>
    </div>
</div>



<script>
    (function () {
        $('.llll').on('click', function(){
            // debugger;
            var id=$(this).attr("id")
            layer.prompt({title: '请输入编辑的等级，并确认', formType: 3}, function(vlaue, index){
                // href="<?php echo url('admin/user/editlevel',['id'=>$vo['id']]); ?>"
                $.ajax({
                    url: 'editlevel',
                    type: 'get',
                    // 设置的是请求参数
                    data: { id: id, level: vlaue },
                    // 用于设置响应体的类型 注意 跟 data 参数没关系！！！
                    dataType: 'json',
                    success: function (res) {
                        // 一旦设置的 dataType 选项，就不再关心 服务端 响应的 Content-Type 了
                        // 客户端会主观认为服务端返回的就是 JSON 格式的字符串
                        window.location.reload()
                    }
                })
                layer.close(index);
                // layer.prompt({title: '随便写点啥，并确认', formType: 2}, function(text, index){
                //     layer.close(index);
                //     layer.msg('演示完毕！您的口令：'+ pass +'<br>您最后写下了：'+text);
                // });
            });
            // layer.open({
            //     type: 1
            //     ,title: false //不显示标题栏
            //     ,closeBtn: false
            //     ,area: '300px;'
            //     ,shade: 0.8
            //     ,id: 'LAY_layuipro' //设定一个id，防止重复弹出
            //     ,btn: ['火速围观', '残忍拒绝']
            //     ,btnAlign: 'c'
            //     ,moveType: 1 //拖拽模式，0或者1
            //     ,content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">你知道吗？亲！<br>layer ≠ layui<br><br>layer只是作为Layui的一个弹层模块，由于其用户基数较大，所以常常会有人以为layui是layerui<br><br>layer虽然已被 Layui 收编为内置的弹层模块，但仍然会作为一个独立组件全力维护、升级。<br><br>我们此后的征途是星辰大海 ^_^</div>'
            //
            //
            //     ,success: function(layero){
            //         var btn = layero.find('.layui-layer-btn');
            //         btn.find('.layui-layer-btn0').attr({
            //             href: 'http://www.layui.com/'
            //             ,target: '_blank'
            //         });
            //     }
            // });
        });
    })();
    function tips() {
        layer.prompt({title: '输入任何口令，并确认', formType: 1}, function(pass, index){
            layer.close(index);
            layer.prompt({title: '随便写点啥，并确认', formType: 2}, function(text, index){
                layer.close(index);
                layer.msg('演示完毕！您的口令：'+ pass +'<br>您最后写下了：'+text);
            });
        });
    }
</script>


    <!--底部-->
    <div class="layui-footer footer">
        <div class="layui-main">
            <p>2016-2017 &copy; <a href="https://github.com/xiayulei/open_source_bms" target="_blank">Open Source BMS</a></p>
        </div>
    </div>
</div>

<script>
    // 定义全局JS变量
    var GV = {
        current_controller: "admin/<?php echo (isset($controller) && ($controller !== '')?$controller:''); ?>/",
        base_url: "__STATIC__"
    };
</script>
<!--JS引用-->

<script src="__JS__/layui/lay/dest/layui.all.js"></script>
<script src="__JS__/admin.js"></script>

<!--页面JS脚本-->

</body>
</html>